<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>layout 管理系统大布局 - Layui</title>
    <link rel="stylesheet" href="../layui/css/layui.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header ">
        <div class="layui-logo layui-hide-xs layui-bg-black">管理系统</div>
        <!-- 头部区域 -->
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                <a href="javascript:;" >
                    <img src="/images/img.png" class="layui-nav-img">
                    <span class="dept"></span>&nbsp;&nbsp;&nbsp;
                    <span class="loginStaff"></span>
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="javascript:toJumpGet($('.layui-body'),'/pages/staff/personal.html')">个人中心</a></dd>
                    <!--<dd><a href="/pages/login.html" onclick="return layer.confirm('确定退出登录吗?')">退出登录</a></dd>-->
                    <dd><a href="" id="logoff">退出登录</a></dd>
                </dl>
            </li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">客户管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:toJumpGet($('.layui-body'),'/pages/客户信息.html')">客户信息</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">仓库货架管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:toJumpGet($('.layui-body'),'/pages/仓库信息.html')">仓库信息</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">材料供应商管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:toJumpGet($('.layui-body'),'/pages/材料供应商信息.html')">材料供应商信息</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">订单管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:toJumpGet($('.layui-body'),'/pages/客户订单.html')">客户订单</a></dd>
                        <dd><a href="javascript:toJumpGet($('.layui-body'),'/pages/材料订单.html')">采购订单</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">库存管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:toJumpGet($('.layui-body'),'/pages/材料库存.html')">原料库存</a></dd>
                        <dd><a href="javascript:toJumpGet($('.layui-body'),'/pages/产品库存.html')">产品库存</a></dd>
                        <dd><a href="javascript:toJumpGet($('.layui-body'),'/pages/批次管理.html')">批次管理</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a>产品规格管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:toJumpGet($('.layui-body'),'/pages/ct/ctList.html');">查看产品规格表</a></dd>
                        <dd><a href="javascript:toJumpGet($('.layui-body'),'/pages/ct/ctAdd.html');">添加产品规格</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a>产品信息管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:toJumpGet($('.layui-body'),'/pages/pi/piList.html');">查看产品信息表</a></dd>
                        <dd><a href="javascript:toJumpGet($('.layui-body'),'/pages/pi/piAdd.html');">添加产品信息</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">员工管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:toJumpGet($('.layui-body'),'/pages/staff/staffList.html')">员工信息</a></dd>
                        <dd><a href="javascript:toJumpGet($('.layui-body'),'/pages/staff/addStaff.html')">员工入职</a></dd>
                        <dd><a href="javascript:toJumpGet($('.layui-body'),'/pages/staff/removeStaff.html')">员工离职</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <div class="layui-anim layui-anim-downbit" style="font-size: 100px;font-weight: bold;line-height: 550px;margin-left: 50px">欢迎使用速盟链条管理系统</div>
        <!-- 内容主体区域 -->
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        <!--底部固定区域-->
    </div>
</div>
<script src="../layui/layui.js"></script>
<script src="../js/jquery-1.8.3.js"></script>
<script src="../js/jump.js"></script>
<script>

    /*表格数据*/
    layui.use(['table', 'form', 'layer'], function(){
        var table = layui.table
            , form = layui.form
            ,layer = layui.layer
            , $ = layui.$;

        /*为退出登录绑定事件*/
        $("#logoff").on("click",function () {

            $.post(
                "/s/logoff",{},function (res) {
                    //判断是否执行成功
                    if(res.success=="true"){

                        layer.confirm('确认退出登录吗？', {
                            btn: ['确认','取消'] //按钮
                        }, function(){
                            location="/pages/login.html";

                        }, function(index){
                            layer.close(index);
                        });

                    }
                }

            )
            return false;

        })

    });

    /* 获取登录员工信息*/
    $.post(
        "/s/loginStaff",{},function (res){
            var loginStaff=res.data;
            var staffId=loginStaff.id;
            id=staffId;
            staff=loginStaff;

            if (res.success == "true"){
                $(".dept").text(loginStaff.dept.name);
                $(".loginStaff").text(loginStaff.realName);
            }
        }
    );



</script>
</body>
</html>